from flask import Blueprint
from src.core import user_core
from src.utils.error_util import CoreException
from src.utils import api_util
import logging
from src.utils.token_util import token_verify

logger = logging.getLogger(__name__)

audit = Blueprint('audit', __name__, url_prefix='/audit')

# 获取登录类型
@audit.route('/audit_test', methods=['GET'])
@token_verify
def login_type(current_user):
    try:
        logger.info("audit api test")
    except CoreException as e:
        return api_util.fail(error_msg=e.message, code=e.code)
    except Exception as e:
        return api_util.fail(error_msg=str(e), code="500")
    return api_util.success(data="audit success")

# 测试服务
@audit.route('/ping', methods=['GET'])
def ping():
    print("pong")
    return 'pong'


if __name__ == '__main__':
    print()